package com.iplant.pdm.service.po.bop.partpoint;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.ams.service.basicenum.ams.fxt.AMSFrockType;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;
import java.util.Objects;

/**
 * 工艺工序-工装
 *
 * @author YouWang·Peng
 * 2023-7-27 10:53:50
 */
@DBBasePO(TableName = "fpc_routefrocktool", CheckName = {"Code", "RouteID,RoutePartID,RoutePartPointID,FrockToolID"},
        CodeAuto = true, CodePrefix = "RGZ-", CodeNum = 4, Schemas = DBSchemas.PDM)
public class FPCRouteFrockTool extends BasePO implements Serializable {
    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    @DBCondition
    @DBField
    public int RouteID = 0;//工艺路线ID
    @DBJoin(name = "Code", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteCode = "";//工艺路线编码
    @DBJoin(name = "Version", tableName = "fpc_route", tableAsName = "route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteVersion = "";//工艺路线版本

    @DBCondition
    @DBField
    public int RoutePartID = 0; // 工艺集ID
    @DBJoin(name = "Name", tableName = "fpc_routepart", tableAsName = "routepart1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartID")
    public String RoutePartName = ""; // 工艺集名称
    @DBJoin(name = "Code", tableName = "fpc_routepart", tableAsName = "routepart1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartID")
    public String RoutePartCode = ""; // 工艺集编码
    @DBJoin(name = "OrderID", tableName = "fpc_routepart", tableAsName = "routepart1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartID")
    public String RoutePartOrder = ""; // 工艺集顺序

    @DBCondition
    @DBField
    public int RoutePartPointID = 0; // 工艺工序ID
    @DBJoin(name = "Name", tableName = "fpc_routepartpoint", tableAsName = "routepartpoint1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartPointID")
    public String RoutePartPointName = ""; // 工艺工序名称
    @DBJoin(name = "Code", tableName = "fpc_routepartpoint", tableAsName = "routepartpoint1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartPointID")
    public String RoutePartPointCode = ""; // 工艺工序编码
    @DBJoin(name = "OrderID", tableName = "fpc_routepartpoint", tableAsName = "routepartpoint1", Schemas = DBSchemas.PDM,
            MainTableField = "RoutePartPointID")
    public int RoutePartPointOrder=0;

    /**
     * 工装ID
     */
    @DBCondition
    @DBField
    public int FrockToolID = 0;
    /**
     * 工装名称
     */
    @DBJoin(name = "Name", tableName = "ams_asset_standard_model", tableAsName = "ams_asset_list1", Schemas =
            DBSchemas.AMS, JoinIndex = 3,
            ConditionalJoin = "ams_asset_list1.ID=frocktool1.StandardModelID")
    public String FrockToolName = "";
    /**
     * 工装编码
     */
    @DBJoin(name = "Code", tableName = "ams_asset_standard_model", tableAsName = "ams_asset_list1", Schemas =
            DBSchemas.AMS, JoinIndex = 3,
            ConditionalJoin = "ams_asset_list1.ID=frocktool1.StandardModelID")
    public String FrockToolCode = "";

    /**
     * 工装类型
     */
    @DBCondition
    @DBJoin(name = "FrockType", tableName = "ams_frocktool", tableAsName = "frocktool1", Schemas = DBSchemas.AMS,
            MainTableField = "FrockToolID")
    public int FrockType = 0;
    /**
     * 工装类型文本
     */
    public String FrockTypeText = "";

    /**
     * 工装规格
     */
    @DBJoin(name = "AssetModel", tableName = "ams_asset_standard_model", tableAsName = "ams_asset_list1", JoinIndex = 3,
            Schemas =
                    DBSchemas.AMS, ConditionalJoin = "ams_asset_list1.ID=frocktool1.StandardModelID")
    public String Specifications = "";

    /**
     * 所需数量
     */
    @DBField
    public double Number = 0.0;

    @JsonProperty("RouteID")
    public int getRouteID() {
        return RouteID;
    }

    public void setRouteID(int routeID) {
        RouteID = routeID;
    }

    @JsonProperty("RouteCode")
    public String getRouteCode() {
        return RouteCode;
    }

    public void setRouteCode(String routeCode) {
        RouteCode = routeCode;
    }

    @JsonProperty("RouteVersion")
    public String getRouteVersion() {
        return RouteVersion;
    }

    public void setRouteVersion(String routeVersion) {
        RouteVersion = routeVersion;
    }

    @JsonProperty("RoutePartID")
    public int getRoutePartID() {
        return RoutePartID;
    }

    public void setRoutePartID(int routePartID) {
        RoutePartID = routePartID;
    }

    @JsonProperty("RoutePartName")
    public String getRoutePartName() {
        return RoutePartName;
    }

    public void setRoutePartName(String routePartName) {
        RoutePartName = routePartName;
    }

    @JsonProperty("RoutePartCode")
    public String getRoutePartCode() {
        return RoutePartCode;
    }

    public void setRoutePartCode(String routePartCode) {
        RoutePartCode = routePartCode;
    }

    @JsonProperty("RoutePartPointID")
    public int getRoutePartPointID() {
        return RoutePartPointID;
    }

    public void setRoutePartPointID(int routePartPointID) {
        RoutePartPointID = routePartPointID;
    }

    @JsonProperty("RoutePartPointName")
    public String getRoutePartPointName() {
        return RoutePartPointName;
    }

    public void setRoutePartPointName(String routePartPointName) {
        RoutePartPointName = routePartPointName;
    }

    @JsonProperty("RoutePartPointCode")
    public String getRoutePartPointCode() {
        return RoutePartPointCode;
    }

    public void setRoutePartPointCode(String routePartPointCode) {
        RoutePartPointCode = routePartPointCode;
    }

    @JsonProperty("FrockToolID")
    public int getFrockToolID() {
        return FrockToolID;
    }

    public void setFrockToolID(int frockToolID) {
        FrockToolID = frockToolID;
    }

    @JsonProperty("FrockToolName")
    public String getFrockToolName() {
        return FrockToolName;
    }

    public void setFrockToolName(String frockToolName) {
        FrockToolName = frockToolName;
    }

    @JsonProperty("FrockToolCode")
    public String getFrockToolCode() {
        return FrockToolCode;
    }

    public void setFrockToolCode(String frockToolCode) {
        FrockToolCode = frockToolCode;
    }

    @JsonProperty("FrockType")
    public int getFrockType() {
        return FrockType;
    }

    public void setFrockType(int frockType) {
        FrockType = frockType;
    }

    @JsonProperty("FrockTypeText")
    public String getFrockTypeText() {
        FrockTypeText = Objects.requireNonNull(AMSFrockType.getEnumType(FrockType)).getLabel();
        return FrockTypeText;
    }

    public void setFrockTypeText(String frockTypeText) {
        FrockTypeText = frockTypeText;
    }

    @JsonProperty("Specifications")
    public String getSpecifications() {
        return Specifications;
    }

    public void setSpecifications(String specifications) {
        Specifications = specifications;
    }

    @JsonProperty("Number")
    public double getNumber() {
        return Number;
    }

    public void setNumber(double number) {
        Number = number;
    }

    @JsonProperty("RoutePartPointOrder")
    public int getRoutePartPointOrder() {
        return RoutePartPointOrder;
    }

    public void setRoutePartPointOrder(int routePartPointOrder) {
        RoutePartPointOrder = routePartPointOrder;
    }

    @JsonProperty("RoutePartOrder")
    public String getRoutePartOrder() {
        return RoutePartOrder;
    }

    public void setRoutePartOrder(String routePartOrder) {
        RoutePartOrder = routePartOrder;
    }
}
